//
//  CHVisitViewController.swift
//  Checked
//
//  Created by admin on 11/03/2017.
//  Copyright © 2017 shinolr_go. All rights reserved.
//

import UIKit
import SnapKit

class CHVisitViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
		setupUI()
    }

	private func setupUI() {
		view.backgroundColor = .red

		view.addSubview(label)
		view.addSubview(button)

		label.snp.makeConstraints { (make) in
			make.leading.equalToSuperview().offset(50)
            make.top.equalToSuperview().offset(200)
		}

		button.snp.makeConstraints { (make) in
			make.leading.equalTo(label)
			make.top.equalTo(label.snp.bottom)
			make.size.equalTo(CGSize(width: 50, height: 50))
		}
	}

	lazy var label: UILabel = {
		let label = UILabel()
		label.text = "更多精彩剧集资讯, 请登录 Trakt.tv"
		label.textColor = .black
		return label
	}()

	lazy var button: UIButton = {
		let btn = UIButton()
		btn.setTitle("Login", for: .normal)
		btn.setTitleColor(.blue, for: .normal)
		btn.addTarget(self, action: #selector(btnAction), for: .touchUpInside)
		return btn
	}()

	@objc private func btnAction() {
        navigationController?.pushViewController(CHOAuthViewController(), animated: true)
	}

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }

    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        // Get the new view controller using segue.destinationViewController.
        // Pass the selected object to the new view controller.
    }
    */

}
